<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="../static/css/bootstrap.min.css" type="text/css" rel="stylesheet">
<link href="../static/css/font-awesome.min.css" type="text/javascript"
	rel="stylesheet">
<link href="../static/css/bootsnav.css" type="text/css" rel="stylesheet">
<link href="../static/css/normalize.css" type="text/css" rel="stylesheet">
<link href="../static/css/css.css" rel="stylesheet" type="text/css">
<script src="../static/js/jquery-1.11.1.min.js" type="text/javascript"></script>
<!-- <script src="../static/js/bootstrap.min.js" type="text/javascript"></script> -->
<script src="../static/js/bootsnav.js" type="text/javascript"></script>
<script src="../static/js/jquery.js" type="text/javascript"></script>
<!--[if IE]><script src="js/html5.js"></script><![endif]-->
<title>登录</title>
<style>
div.qiyetext {
	text-align: left;
}

input {
	width: 40%;
	height: 32px;
	font-size: 16px;
	border: 0px solid;
	padding: 6px 12px;
	background-color: #D9534F;
	border-radius: 4px;
	-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
	box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
	-webkit-transition: border-color ease-in-out .15s, -webkit-box-shadow
		ease-in-out .15s;
	-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out
		.15s;
	transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}

input:hover {
	background-color: #C9302C;
}
</style>


</head>
<body class="logobg_style">
	<div id="large-header" class="large-header login-page">
		<canvas id="demo-canvas" width="1590" height="711"></canvas>
		<div class="login-form">
			<div class="login-content">
				<h1 class="title_name">用户登录</h1>
				<form method="post" role="form" id="form_login"
					class="login_padding" action="/dologin">
					<div class="form-group clearfix">

						<div class="input-group">
							<div class="input-group-addon">
								<i class="icon_user"></i>
							</div>

							<input type="text" class="form-control" name="username"
								id="username" placeholder="用户名" autocomplete="off"
								maxlength="16">
						</div>

					</div>

					<div class="form-group clearfix">

						<div class="input-group">
							<div class="input-group-addon">
								<i class="icon_password"></i>
							</div>

							<input type="password" class="form-control" name="password"
								id="password" placeholder="密码" autocomplete="off" maxlength="16">
						</div>

					</div>
					<div class="tishi"></div>
					<div class="form-group">
						<i class="fa fa-sign-in"></i>
						<element> <input type="button"
							class="btn btn-danger btn-block btn-login" value="登录" /> </element>
					</div>
					<!-- Implemented in v1.1.4 -->
					<div class="form-group"></div>
					<div class=" textright"></div>
					<div class="qiyetext">
						<a style="color: white;" href="/qiye">企业登录</a>
					</div>
					<input style="color: #fff; margin-left: 223px;" href="javascript:logon();"
						type="button" value="立即注册" id="registerId"
						/>
			</div>
			</form>
		</div>
	</div>
	</div>
<script src="../static/bower_components/jquery/dist/jquery.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="../static/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- AdminLTE App -->
<script src="../static/dist/js/adminlte.min.js"></script>
<script type="text/javascript">
		$(function() {
			$(".btn").click(doLogin);
			// “注册”点击事件
			$("#registerId").on('click',function(){
				debugger
			    window.location.href="sys/logon";
			  })
			
			debugger
		});
		function doLogin() {
			var params = {
				username:$("#username").val(),
				password:$("#password").val(),
			}
			var url = "user/dologin";
			console.log("params", params);
			$.post(url, params, function(result) {
				console.log(result);
				console.log(result.state);
				if (result.state == 1) {
					//跳转到indexUI对应的页面
					location.href="doIndexUI?t="+Math.random();
				} else {
					alert("账号或密码错误"); 
				}
				return false;//防止刷新时重复提交
			});
		}
		
			 
			
			/* $("html").load("logon"); */
		
			// $.getJSON(url,null, alert("success"));
			 /* $("body").empty();  */
			// $("body").load("logon");
		
		
		function doSubmit() {
			document.forms[0].submit();
		}
		
		
	</script>
</body>
</html>
